<style lang='scss'>
	#app {
		height: 100%;
		min-width: 100%;
		position: absolute;
		display: flex;
		flex-direction: column;
		/*min-width: 1320px;*/
		#contain {
			flex-grow: 1;
		}
	}
	.el-color-dropdown .el-color-dropdown__btns .el-button:first-of-type {
		display: none;
	}
</style>
<template>
	<div id="app" v-if="site_show">
		<uHeader></uHeader>
		<router-view id="contain"></router-view>
		<cusFooter></cusFooter>
	</div>
</template>
<script>
	import uHeader from 'components/admin/header.vue';
	import cusFooter from 'components/cus_footer.vue';
	export default {
		data() {
			return {
				site_show: false
			}
		},
		computed: {
			site_icon_url() {
				return this.$store.state.site_icon_url;
			}
		},
		watch: {
			site_icon_url(val) {
				if(val) {
					let link = document.querySelector("link[rel*='icon']") || document.createElement('link');
			    link.type = 'image/x-icon';
			    link.rel = 'shortcut icon';
			    link.href = val;
			    document.getElementsByTagName('head')[0].appendChild(link);
				}
			}
		},
		created() {
			this.$store.dispatch('loadSiteConfig').then(res => {
				this.site_show = true;
			})
		},
		mounted() {
			this.$store.commit('updateSiteIcon');
		},
		components: {
			uHeader,
			cusFooter
		}
	}
</script>